<template>
	<view>
		<u-popup v-model="show" mode="center" height="750upx" width="600upx" border-radius="10" :closeable="true" :borderBottom="false">
			<view class="header-title">线索跟踪</view>
			<view style="color: #666666;padding-left: 28upx;margin-top: 33upx;">1、选择线索状态 <text style="color: #FF0000;">*</text></view>
			<u-radio-group v-model="value" icon-size="22" label-size="26" style="padding: 3%;margin-left: 20upx;">
						<u-radio 
							@change="radioChange" 
							v-for="(item, index) in list" :key="index" 
							:name="item.name"
							:disabled="item.disabled"
						>
							{{item.name}}
						</u-radio>
					</u-radio-group>
			<view style="color: #666666;padding-left: 28upx;margin-top: 20upx;">2、输入报名金额 <text style="color: #FF0000;">*</text></view>
			<view style="padding-left: 28upx;padding-right: 28upx;margin-top: 21upx;">
				<u-input v-model="money" :type="type" :border="border" />
			</view>
			<view style="color: #666666;padding-left: 28upx;margin-top: 20upx;">3、备注信息</view>
			<view style="padding-left: 28upx;padding-right: 28upx;margin-top: 21upx;">
				<u-input v-model="valueInput" type="textarea" :border="border" />
			</view>
			<view style="width: 100%;display: flex;justify-content: flex-end;padding-right: 25upx;margin-top: 31upx;">
				<view class="btn-tj" @click="getFollowAdd">提交</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default{
		data () {
			return {
				id: '',
				clue_agency_id: '',
				show: false,
				valueInput: '',
				money: '',
				status: '',
				type: 'text',
				border: true,
				list: [
						{
							name: '考虑中',
							disabled: false
						},
						{
							name: '已预约',
							disabled: false
						},
						{
							name: '已试听',
							disabled: false
						},
						{
							name: '已报名',
							disabled: false
						},
						{
							name: '无意向',
							disabled: false
						}
				],
				// u-radio-group的v-model绑定的值如果设置为某个radio的name，就会被默认选中
				value: '考虑中',
			}
		},
		methods:{
			radioChange(e) {
						console.log(e);
						switch (e) {
							case '待处理':
							this.status = 0
							break;
							case '无意向':
							this.status = 1
							break;
							case '考虑中':
							this.status = 2
							break;
							case '已预约':
							this.status = 3
							break;
							case '已试听':
							this.status = 4
							break;
							case '已报名':
							this.status = 5
							break;
							case '疑似报名':
							this.status = 6
							break;
						}
					},
			getOpen (id, clue_agency_id) {
				this.id = id
				this.clue_agency_id = clue_agency_id
				this.show = true
			},
			getFollowAdd() {
				this.$request('', '/agencyApi/v1/clueFollowupAdd', 'GET', {
					clue_agency_id: this.clue_agency_id,
					clue_id: this.id,
					status: this.status,
					money: this.money,
					remark: this.valueInput
				}, {
				}).then(res => {
					// this.list = res.data
					console.log(res.data)
					this.show = false
					this.$emit('getList')
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.btn-tj{
		width: 138upx;
		height: 64upx;
		background-image: url(../../static/lstj.png);
		background-size: 100% 100%;
		text-align: center;
		line-height: 64upx;
		color: #FFFFFF;
		// text-align: right;
	}
	.header-title{
		font-size: 28upx;
		font-family: PingFang SC;
		font-weight: bold;
		padding-top: 28upx;
		padding-left: 28upx;
	}
</style>
